<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>体育馆场地预约管理系统-注册</title>
    <%
        String basePath = request.getScheme()
                + "://" + request.getServerName()
                + ":" + request.getServerPort()
                + request.getContextPath()
                + "/";
    %>
    <base href="<%=basePath%>">

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <style>
        body {
            background-image: url("<%=request.getContextPath()%>/img/bg.png");
            background-attachment: fixed;
            background-size: 100%;
            no-repeat: center top;
            height: 100%;
            width: 100%;
        }
    </style>

    <script src="js/jquery-3.1.1.min.js"></script>
    <script>
        $(function () {
            let $username = $('#username');
            let $password = $('#password');
            let $msg = $('#msg');

            /*$username.blur(function () {
                let text = $username.val();
                if (text.trim() === "") {
                    $msg.text("用户名不能为空！");
                }
            })

            $password.blur(function () {
                let text = $password.val();
                if (text.trim() === "") {
                    $msg.text("密码不能为空！");
                }
            })*/

            $('#submit').click(function (){
                let text = $username.val();
                if (text.trim() === "") {
                    $msg.text("用户名不能为空！");
                    return false
                }

                let text2 = $password.val();
                if (text2.trim() === "") {
                    $msg.text("密码不能为空！");
                    return false
                }
            })
        })
    </script>

</head>

<body>

    <div class="middle-box text-center loginscreen   animated fadeInDown">
        <div>
            <div>

                <h2 style="color: #7e7676">体育馆场地预约管理系统</h2>

            </div>
            <h3>欢迎注册</h3>
            <div id="msg" style="color: red">${msg}</div>
            <form class="m-t" method="post" role="form" action="userController">
                <input type="hidden" name="action" value="regist">
                <div class="form-group">
                    <input type="text" id="username" name="username" class="form-control" placeholder="用户名">
                </div>
                <div class="form-group">
                    <input type="password" id="password" name="password" class="form-control" placeholder="密码">
                </div>
                <button id="submit" type="submit" class="btn btn-primary block full-width m-b">注册</button>

                <a class="btn btn-sm btn-white btn-block" href="login.jsp">点击登录</a>
            </form>
            <p class="m-t"> <small>体育馆场地预约管理系统&copy; 2022</small> </p>
        </div>
    </div>

    <!-- Mainly scripts -->
    <script src="js/jquery-3.1.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <!-- iCheck -->
    <script src="js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function(){
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });
    </script>
</body>

</html>
